package br.ufrj.dcc.tp.cliente.controller;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

public class TextAreaController extends KeyAdapter {
	
	/** Controller do cliente. */
	private ClientController controller;
	
	public TextAreaController(ClientController controller) {
		this.controller = controller;
	}
	
	@Override
	public void keyTyped(KeyEvent e) {
		if( e.getKeyChar() == KeyEvent.VK_ENTER &&
			e.getModifiersEx() == KeyEvent.CTRL_DOWN_MASK ) {
			
			// Chamar o SEND message!!
			controller.sendMessage();
			e.consume();
		}
	}
}
